function class_num = Classify(traj, max_period, LE_max)
    if max(abs(traj)) > 1e3
        class_num = 10; % UB 不稳定
        return;
    end

    if max(traj) - min(traj) < 0.4
        class_num = 1; % P0 定点
        return;
    end

    [pks, ~] = findpeaks(traj);
    if length(pks) < 2
        class_num = 1;
        return;
    end

    pks_norm = pks / max(abs(pks));
    for period = 1:max_period
        repeated = true;
        for i = 1:(length(pks_norm) - period)
            if abs(pks_norm(i) - pks_norm(i + period)) > 0.2
                repeated = false;
                break;
            end
        end
        if repeated
            class_num = period + 1;
            return;
        end
    end

    if LE_max > 0
        class_num = 9; % CH 混沌
    else
        class_num = 8; % MP 多周期
    end
end